import Vue from "vue";

const constentDisplayRoute = [
  {
    name: "报告管理",
    icon: "report",
    route: "/reportManage",
    // redirect: "/reportList",
    child: [
      {
        name: "报告列表",
        route: "/reportList",
      },
      {
        name: "添加报告",
        route: "/addReport",
      },
    ],
  },
  {
    name: "财务管理",
    icon: "report",
    route: "/reportOrder",
    // redirect: "/reportList",
    child: [
      {
        name: "订单管理",
        route: "/reportOrder",
      },
      {
        name: "发票管理",
        route: "/receiptManage",
      },
    ],
  },
  {
    name: "数据地图",
    icon: "report",
    route: "/dataMap",
    child: [
      // {
      //   name: "数据看板",
      //   route: "/dataBoard",
      // },
      {
        name: "报告分类-部门",
        route: "/reportClassify/allReport",
      },
      // {
      //   name: "目标管理",
      //   route: "/targetManage",
      // },
    ],
  },
  {
    name: "数据统计",
    icon: "report",
    route: "/dataManage",
    child: [
      {
        route: "/shareReportData",
        name: "报告分享数据",
      },

      {
        route: "/DistributeData",
        name: "分销活动数据",
      },
      {
        route: "/shareReportDataIndex",
        name: "分享活动数据",
      },
      {
        route: "/liveShareData",
        name: "直播分享数据",
      },
      // {
      //   route: "/consultData",
      //   name: "职业顾问数据",
      // },
      // {
      //   route:"/departmentData",
      //   name:"职业顾问数据"
      // },
      {
        route: "/consultFrontList",
        name: "职业顾问数据",
      },
    ],
  },
  {
    name: "内容管理",
    icon: "report",
    route: "/contentManage",
    child: [
      {
        name: "专业分类",
        route: "/categoryManage",
      },
      {
        name: "行业分类",
        route: "/industryManage",
      },
      {
        name: "职业分类",
        route: "/occupationManage",
      },

      {
        name: "直播管理",
        route: "/liveManage",
      },
      // {
      //   name: "频道管理",
      //   route: "/channelCategoryManage",
      // },
      // {
      //   name: "标签管理",
      //   route: "/tagManage",
      // },
    ],
  },
  {
    name: "分销系统",
    icon: "report",
    route: "/teamManage",
    child: [
      {
        route: "/teamManage",
        name: "团队管理",
      },
      {
        route: "/agentManage",
        name: "代理管理",
      },
    ],
  },
  // {
  //   name: "发票管理",
  //   icon: "receipt",
  //   route: "/receiptManage",
  // },
];
let permissionList = [
  {
    permsButtonType: "",
    icon: "report",
    permission: "",
    remark: "",
    updateTime: "2022-10-31 16:40:57",
    type: 1,
    parentid: "0",
    url: "/contentManege",
    hideFlag: 1,
    levelNum: null,
    ruleFlag: 0,
    createTime: "2022-10-31 16:40:58",
    appId: "DEFAULT_APP_ID",
    hasChild: null,
    name: "职业报告中台内容管理",
    ranking: 1,
    id: "584",
    longPermsId: "10000584!",
    status: 1,
    menuPermsMoreList: null,
    permissionChildList: [
      {
        menuPermsMoreList: null,
        permissionChildList: [
          {
            menuPermsMoreList: null,
            permissionChildList: null,
            permsButtonType: null,
            icon: null,
            permission: "articleFirstAudit",
            remark: "",
            updateTime: null,
            type: 3,
            parentid: "585",
            url: null,
            hideFlag: null,
            levelNum: null,
            ruleFlag: null,
            createTime: null,
            appId: null,
            hasChild: null,
            name: "职讯管理一审权限",
            ranking: 1,
            id: "10001198",
            longPermsId: null,
            status: null,
          },
          {
            menuPermsMoreList: null,
            permissionChildList: null,
            permsButtonType: null,
            icon: null,
            permission: "articleSecondAudit",
            remark: "",
            updateTime: null,
            type: 3,
            parentid: "585",
            url: null,
            hideFlag: null,
            levelNum: null,
            ruleFlag: null,
            createTime: null,
            appId: null,
            hasChild: null,
            name: "职讯管理二审权限",
            ranking: 2,
            id: "10001200",
            longPermsId: null,
            status: null,
          },
          {
            menuPermsMoreList: null,
            permissionChildList: null,
            permsButtonType: null,
            icon: null,
            permission: "articleThirdAudit",
            remark: "",
            updateTime: null,
            type: 3,
            parentid: "585",
            url: null,
            hideFlag: null,
            levelNum: null,
            ruleFlag: null,
            createTime: null,
            appId: null,
            hasChild: null,
            name: "职讯管理三审权限",
            ranking: 3,
            id: "10001201",
            longPermsId: null,
            status: null,
          },
          {
            menuPermsMoreList: null,
            permissionChildList: null,
            permsButtonType: null,
            icon: null,
            permission: "articleAllAudit",
            remark: "",
            updateTime: null,
            type: 3,
            parentid: "585",
            url: null,
            hideFlag: null,
            levelNum: null,
            ruleFlag: null,
            createTime: null,
            appId: null,
            hasChild: null,
            name: "职讯管理全部审核权限",
            ranking: 4,
            id: "10001202",
            longPermsId: null,
            status: null,
          },
        ],
        permsButtonType: "",
        icon: "report",
        permission: "",
        remark: "",
        updateTime: "2022-11-01 10:40:33",
        type: 1,
        parentid: "584",
        url: "/ArticleManage",
        hideFlag: 1,
        levelNum: null,
        ruleFlag: 0,
        createTime: "2022-11-01 10:40:33",
        appId: "DEFAULT_APP_ID",
        hasChild: null,
        name: "职讯管理",
        ranking: 0,
        id: "585",
        longPermsId: "10000584!10000585!",
        status: 1,
      },
      {
        menuPermsMoreList: null,
        permissionChildList: [
          {
            menuPermsMoreList: null,
            permissionChildList: null,
            permsButtonType: null,
            icon: null,
            permission: "videoFirstAudit",
            remark: "",
            updateTime: null,
            type: 3,
            parentid: "586",
            url: null,
            hideFlag: null,
            levelNum: null,
            ruleFlag: null,
            createTime: null,
            appId: null,
            hasChild: null,
            name: "视频管理一审权限",
            ranking: 1,
            id: "10001197",
            longPermsId: null,
            status: null,
          },
          {
            menuPermsMoreList: null,
            permissionChildList: null,
            permsButtonType: null,
            icon: null,
            permission: "videoSecondAudit",
            remark: "",
            updateTime: null,
            type: 3,
            parentid: "586",
            url: null,
            hideFlag: null,
            levelNum: null,
            ruleFlag: null,
            createTime: null,
            appId: null,
            hasChild: null,
            name: "视频管理二审权限",
            ranking: 2,
            id: "10001203",
            longPermsId: null,
            status: null,
          },
          {
            menuPermsMoreList: null,
            permissionChildList: null,
            permsButtonType: null,
            icon: null,
            permission: "videoThirdAudit",
            remark: "",
            updateTime: null,
            type: 3,
            parentid: "586",
            url: null,
            hideFlag: null,
            levelNum: null,
            ruleFlag: null,
            createTime: null,
            appId: null,
            hasChild: null,
            name: "视频管理三审权限",
            ranking: 3,
            id: "10001204",
            longPermsId: null,
            status: null,
          },
          {
            menuPermsMoreList: null,
            permissionChildList: null,
            permsButtonType: null,
            icon: null,
            permission: "videoAllAudit",
            remark: "",
            updateTime: null,
            type: 3,
            parentid: "586",
            url: null,
            hideFlag: null,
            levelNum: null,
            ruleFlag: null,
            createTime: null,
            appId: null,
            hasChild: null,
            name: "视频管理全部审权限",
            ranking: 4,
            id: "10001205",
            longPermsId: null,
            status: null,
          },
        ],
        permsButtonType: "",
        icon: "report",
        permission: "",
        remark: "",
        updateTime: "2022-11-01 10:40:49",
        type: 1,
        parentid: "584",
        url: "/VideoManage",
        hideFlag: 1,
        levelNum: null,
        ruleFlag: 0,
        createTime: "2022-11-01 10:40:50",
        appId: "DEFAULT_APP_ID",
        hasChild: null,
        name: "视频管理",
        ranking: 0,
        id: "586",
        longPermsId: "10000584!10000586!",
        status: 1,
      },
    ],
  },
];
let hasPermissons = [];
permissionList.map((item) => {
  if (item.name == "职业报告中台内容管理" && item.permissionChildList) {
    item.permissionChildList.map((_item) => {
      const _obj = { name: _item.name, route: _item.url, icon: _item.icon };
      hasPermissons.push(_obj);
    });
  }
});

constentDisplayRoute.forEach((item) => {
  if (item.name == "内容管理") {
    item.child = [...item.child, ...hasPermissons];
  }
});

// Vue.prototype.$menuList = constentDisplayRoute;
